package com.campus.service.impl;

import com.campus.dao.CourseDao;
import com.campus.dto.CourseDto;
import com.campus.model.Course;
import com.campus.service.TeacherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private CourseDao courseDao;
    @Override
    public Integer addCourse(CourseDto courseDto) {
        Course course = new Course();
        course.setCourse_id(courseDto.getCourse_id());
        course.setCourse_name(courseDto.getCourse_name());
        course.setCreated_time(courseDto.getCreated_time());
        course.setStatus(courseDto.getStatus());
        course.setActivity_id(courseDto.getActivity_id());
        course.setTeacher_id(courseDto.getTeacher_id());
        course.setClass_id(courseDto.getClass_id());
        return courseDao.addCourse(course);
    }
}
